class Person {
    #name;
    constructor(name) {
        this.#name = name;
    }
    get name() {
        return this.#name;
    }
    set name(name) {
        this.#name = name;
    }
    sayHello() {
        console.log("Hi,I am " + this.#name + "!");
    }
}
class Student extends Person {
    #sid;
    #major;
    constructor(name, sid, major) {
        super(name);
        this.#sid = sid;
        this.#major = major;
    }
    get sid() { return this.#sid; }
    set sid(sid) { this.#sid = sid; }
    get major() { return this.major; }
    set major(major) { this.#major = major; }
    sayHello() {
        super.sayHello();
        console.log("I'm from " + this.#major + ".");
    }
}
let p = new Person('Alice');
p.sayHello();
let s = new Student('Bob', '1083710315', 'CS');
console.log(s.name);
s.sayHello();